#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""StaffLog - Services
@version: 0.1
@license: GPL 3.0 (see "license" file)
@author: Jose A. Jimenez <jajimc@gmail.com>, Miguel Centeno <miguelcent@gmail.com>"""

import sys
import os
DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
sys.path.append("/usr/share/predesys-server/core")
import data

if __name__ == "__main__":
    dbConnection = data.open_connection()
    
    scriptPath = os.path.join(DIR, "install_stafflog.sql")
    script = open(scriptPath, "r")
    content = script.read()
    script.close()
    
    data.execute(dbConnection, content)
    data.close_connection(dbConnection)
